<!DOCTYPE html>
<html lang="zh-cn">
<head>
	<meta charset="UTF-8">
	<title><?=$sys['web_site_title'];?></title>
    <meta name='keywords' content='<?=$sys['web_site_keywords'];?>'>
    <meta name='description' content='<?=$sys['web_site_description'];?>'>
    <link rel='stylesheet' type='text/css' href='/static/www/pc.css?v=<?=env('version')?>'>
    <link rel='stylesheet' type='text/css' href='/static/www/lib.css?v=<?=env('version')?>'>
    <script src="https://cdn.bootcss.com/jquery/1.11.2/jquery.min.js?v=<?=env('version')?>"></script>
    <script type='text/javascript' src='/static/www/lib.js?v=<?=env('version')?>'></script>
    <script type='text/javascript' charset='UTF-8' src='/static/www/pc.js?v=<?=env('version')?>'></script>
	<script type="text/javascript" src="/static/admin/common/layui/layui.js?v=<?=env('version')?>"></script>
	<script type="text/javascript" src="/static/vendor/function.js?v=<?=env('version')?>"></script>
</head>
<body>
<div class="ufrom_header">
	<div class="logo w1200">
    	<a href="/index/"><img src="<?=$com['img']['login_logo']['pic'];?>"></a><span>找回密码</span>
    </div>
</div>
<!--登录中间层开始-->
<div class="ufrom_content">
  <div class="inner_from w1200">
    <div class="from_pic">
		<img src="<?=$com['img']['login_ad']['pic'];?>">
	</div>
    <div class="form_box" style="height: 376px;">
     <div id="inner2" class="inner" style="display:block">
      <form name="usLoginForm" class="layui-form" action=''>
          <div class="form_title">找回密码<a href="/publics/login" class="href">记得密码？去登录！</a></div>
            <div class="form_inpt"> <span class="form_label" title="请输入帐号昵称"><i class="userName"></i></span>
              <input name="userphone" type="text" required lay-verify="required" class="write_text" maxlength="20">
              <span class="placeholder">请输入手机号</span> </div>
          <div class="form_inpt"> <span class="form_label"><i class="Pwd"></i></span>
            <input name="password" type="password" required lay-verify="required" class="write_text" maxlength="20">
            <span class="placeholder">新密码</span> <i class="setType_btn" title="查看密码"></i></div>
		<div class="form_code">
		  <input name="code" type="text" class="write_don" maxlength="20"  required lay-verify="required" placeholder="图形验证码">
		  <a href="javascript:;" class="code_btn"><img src="/publics/captcha.html" id="ProveImg" onclick="this.src='/publics/captcha?t='+Math.random()" title='换一张' style="cursor: pointer;"></a>
		  <div class="clear"></div>
		  </div>
          <div class="form_code">
            <input name="code" type="text" required lay-verify="required" aria-label="输入验证码" class="write_don" maxlength="20" placeholder="短信验证码">
            <button type="button" class="post_btn_code" lay-ignore style="background:#999999" onclick="sendsms(this,60,'forget')">获取验证码</button>
            <div class="clear"></div>
          </div>
          <div class="form_submit">
            <input type="button" id="form_btn" lay-filter="myform" style="background:#e4393c" class="form_btn" value="立即重置">
          </div>
      </form>
      </div
    </div>
  </div>
</div>

<!--底部-->
<!--底部-->
<div class='footer'>
	<div class='w1200'>
<?php include_once __DIR__.'/../inc/bottom.html';?>
	</div>
</div>
</body>
</html>
  <script type='text/javascript'>
  //发送短信
  function sendsms(e,second,type){
      var phone = $('[name="userphone"]').val();
	  var code = $("[name='code']").val();
	  var password = $("[name='password']").val();
      var reg = /^1[0-9]{10}$/;
      if(!reg.test(phone)){
          layer.msg('请填写正确的手机号');
		  return false;
      }
      if(!code){
          layer.msg('请填填写图形验证码');
		  return false;
      }
	  if(!password || password.length<6){
	  	layer.msg('密码长度至少6位数');
	  	return false;
	  }
		$.ajax({
			url:"<?=url('publics/sendSms');?>",
			method:"post",
			dataType:"json",
			data:{phone:phone,type:type,code:code},
			success:function(rs){
	            if(rs.code!=0){
	                _action(rs);
	                return false;
	            }
				$(e).attr("disabled");
				$(e).text("重新发送(" + second + ")");
	            var index = setInterval(function(rs) {
					countdown = parseInt(/(\d+)/gi.exec($(e).text()));
					if (countdown == 0) {
		                $(e).removeAttr("disabled");
		                $(e).text("获取验证码");
						clearInterval(index);
		                return false;
		            } else {
		                $(e).attr("disabled", true);
		                countdown--;
		                $(e).text("获取验证码(" + countdown + ")");
		            }
	            },1000);
			}
		});
    }
  </script>
